﻿using System;

namespace NMA.Infrastructure.NHibernate.DomainObject
{
    using NMA.Domain.Model;
    using NMA.Domain.Shared;
    using NMA.Infrastructure.DBC;    

    public class Poll : BaseEntity<IPoll>, INameEntity<IPoll>, IPoll
    {
        public virtual string Name { get; set; }

        public virtual int Value { get; set; }

        public virtual DateTime VoteDate { get; set; }

        public virtual string WhoVote { get; set; }

        public virtual string CreatedUser { get; set; }

        public virtual string UpdatedUser { get; set; }

        //public virtual News News
        //{
        //    get;
        //    set;
        //}

        public Poll()
        {
            
        }

        //public virtual void AddNews(News news)
        //{
        //    news.AssignPoll(this);
        //    News = news;
        //}

        public override bool SameIdentityAs(IPoll other)
        {
            Check.Assert(other == null, "Poll is null");

            return other.Id == this.Id;
        }
    }
}
